﻿using MiniFox.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Repository.Core.Models.Dto;
using Repository.Core.Models.Queries;
using Repository.Core.Models.VO;
using MiniFox.Components;

namespace Repository.Core.Services
{
    /// <summary>
    /// 发布服务
    /// </summary>
    [AutoRegister]
    public interface IPublishService
    {
        /// <summary>
        /// 
        /// </summary>
        string RepoName {  get; }

        object GetItemContent(string versionSetName);

        /// <summary>
        /// 发布
        /// </summary>
        /// <param name="request"></param>
        void Publish(PublishDto request);
        /// <summary>
        /// 发布
        /// </summary>
        /// <param name="versionSetName"></param>
        /// <param name="versionId"></param>
        void Publish(string versionSetName, long? versionId);

        /// <summary>
        /// 查询所有发布项
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        ResultObject<IEnumerable<PublishVo>> Query(PagedQueryObject<CommonQuery> request);

        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="versionSetName"></param>
        /// <returns></returns>
        T GetItemObject<T>(string versionSetName);
    }
}
